package shared.file

class FileTransferCollection(val name: String) {

  @volatile
  private var list: List[FileTransfer] = Nil
  
  def transfering = { 
    list = list.filter { _.isActive }
    list
  }
  
  def add(ft: FileTransfer) = synchronized {
    list = ft :: list
    ft
  }
  
  def add(n: String, l: Long):FileTransfer = add(new FileTransfer(n, l))
  
  override def toString = name
  
}
